const obj1 = {
  a: 1,
  b: 2
}

const obj2 = {
  b: 3,
  d: 4
}

const obj3 = {
  a: 123,
  c: 456
}

const result = Object.assign(obj3, obj1, obj2);//用后面对象属性覆盖第一个对象

console.log(obj3);
console.log(result == obj3);//true


const result1 = Object.assign({}, obj3, obj1, obj2);//全新的对象
console.log(result1 === obj3);